// 04-listen-radio.js
const Radio = require('./04-radio');

const station = {
  freq: '123',
  name: 'aaaaa'
};

const myRadio = new Radio(station);

myRadio.on('play', (station) => {
  console.log(`Radi playing: ${station.freq}`);
});

myRadio.on('stop', (station) => {
  console.log(`Radio stopped: ${station.name}`);
});

myRadio.play();

setTimeout(() => {
  myRadio.stop();
}, 1000);